﻿using Huasky.Gm.Application.FaultHandle.Dtos;

namespace Huasky.Gm.Application;

/// <summary>
/// 系统服务接口
/// </summary>
public class FaultHandleAppService : IDynamicApiController
{
    private readonly IFaultHandleService service;

    public FaultHandleAppService(IFaultHandleService service)
    {
        this.service = service;
    }

    [HttpPost]
    public async Task<List<FaultRecordDto>> Get(FaultRecordParams para) => await service.GetFaultRecordsAsync(para);


    [HttpPost("add")]
    public async Task<FaultRecordDto> AddRecord(AddFaultRecordDto dto) => await service.AddFaultRecordAsync(dto);

    [HttpDelete("{id}")]
    public async Task RemoveRecord(Guid id) => await service.RemoveFaultRecordAsync(id);

}
